﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a01
    {
		private string _rolecode;
		private string _rolename;
        private int? _comcode;
		private string _remark;
        private DateTime? _mdate;
		private string _muser;
		
        /// <summary>
        /// 组别编码
        /// </summary>
		public string Rolecode
		{
			get { return _rolecode;	 }
			set { _rolecode=value;	}
		}
        /// <summary>
        /// 组别名称
        /// </summary>
		public string Rolename
		{
			get { return _rolename;	 }
			set { _rolename=value;	}
		}
        /// <summary>
        /// 公司标识
        /// </summary>
		public int? Comcode
		{
			get { return _comcode;	 }
			set { _comcode=value;	}
		}
        /// <summary>
        /// 简要说明
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
        /// <summary>
        /// 维护时间
        /// </summary>
		public DateTime? Mdate
		{
			get { return _mdate;	 }
			set { _mdate=value;	}
		}
        /// <summary>
        /// 维护者
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
		
		public static List<Sys0a01> GetSys0a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a01> list = new List<Sys0a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a01 model = GetSys0a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a01 GetSys0a01ByDataRow(DataRow dr)
		{
			Sys0a01 model = new Sys0a01(); //实例化Sys0a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("rolecode")&&!(dr["rolecode"] is System.DBNull))  
				model.Rolecode = ( string)dr["rolecode"];
			if (dcc.Contains("rolename")&&!(dr["rolename"] is System.DBNull))  
				model.Rolename = ( string)dr["rolename"];
			if (dcc.Contains("comcode")&&!(dr["comcode"] is System.DBNull))  
				model.Comcode = ( int)dr["comcode"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			if (dcc.Contains("mdate")&&!(dr["mdate"] is System.DBNull))  
				model.Mdate = ( DateTime)dr["mdate"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			
			return model;
		}
    }
}
